{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name=renderer  content=webkit>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <title>{% trans "个人中心" %}{% if site_name != None and site_name != '' %} - {{site_name}} {% endif %} - {% trans "觅思文档" %}</title>
		<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
		<!-- 依 赖 样 式 -->
		<link rel="stylesheet" href="{% static 'PearAdminLayui/component/pear/css/pear.css' %}" />
		<!-- 加 载 样 式-->
		<link rel="stylesheet" href="{% static 'PearAdminLayui/admin/css/load.css' %}" />
		<!-- 布 局 样 式 -->
		<link rel="stylesheet" href="{% static 'PearAdminLayui/admin/css/admin.css' %}" />
	<!-- 结 构 代 码 -->
	<body class="layui-layout-body pear-admin">
		<!-- 布 局 框 架 -->
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<!-- 顶 部 左 侧 功 能 -->
				<ul class="layui-nav layui-layout-left">
					<li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
					<li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading=600></a></li>
				</ul>
				<!-- 顶 部 右 侧 菜 单 -->
				<div id="control" class="layui-layout-control"></div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
					<li class="layui-nav-item layui-hide-xs"><a href="{% url 'pro_list' %}" class="layui-icon layui-icon-home" title="回到首页"></a></li>
					<li class="layui-nav-item">
						<!-- 头 像 -->
						<a href="javascript:;">
							<img src="{% static 'PearAdminLayui/avatar.svg' %}" class="layui-nav-img">
							{% if request.user.first_name != '' %} {{request.user.first_name}} {% else %} {{request.user.username}}{% endif %}
						</a>
						<!-- 功 能 菜 单 -->
						<dl class="layui-nav-child">
							{% if request.user.is_superuser %}
							<dd><a href="{% url 'admin_center' %}">{% trans "后台管理" %}</a></dd>
							{% endif %}
							<dd><a href="{% url 'pro_list' %}">{% trans "返回首页" %}</a></dd>
						  	<dd><a href="javascript:void(0)" title="退出登录" onclick="Logout()">{% trans "退出登录" %}</a></dd>
						</dl>
					</li>
					<!-- 主 题 配 置 -->
					<li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
				</ul>
			</div>
			<!-- 侧 边 区 域 -->
			<div class="layui-side layui-bg-black">
				<!-- 顶 部 图 标 -->
				<div class="layui-logo">
					<img class="logo"></img>
					<span class="title"></span>
				</div>
				<!-- 侧 边 菜 单 -->
				<div class="layui-side-scroll">
					<div id="sideMenu"></div>
				</div>
			</div>
			<!-- 视 图 页 面 -->
			<div class="layui-body">
				<div id="content"></div>
			</div>
			<!-- 遮 盖 层 -->
			<div class="pear-cover"></div>
			<!-- 加 载 动 画-->
			<div class="loader-main">
				<div class="loader"></div>
			</div>
		</div>
		<!-- 移 动 端 便 捷 操 作 -->
		<div class="pear-collasped-pe collaspe">
			<a href="#" class="layui-icon layui-icon-shrink-right"></a>
		</div>
		<!-- 依 赖 脚 本 -->
		<script src="{% static 'PearAdminLayui/component/layui/layui.js' %}"></script>
		<script src="{% static 'PearAdminLayui/component/pear/pear.js' %}"></script>
		<!-- 框 架 初 始 化 -->
		<script>
			layui.use(['admin','jquery','convert','popup'], function() {
				var admin = layui.admin;
				var $ = layui.jquery;
				var convert = layui.convert;
				var popup = layui.popup;
                var pear_admin_config = {
                    "logo": {
                        "title": "{% trans '个人中心' %}",
                        "image": "{% static 'mrdoc_logo_ridus.png' %}"
                    },
                    "menu": {
                        "data": "{% url 'user_center_menu' %}",
                        "accordion": true,
                        "control": false,
                        "select": "10"
                    },
                    "tab": {
                        "muiltTab": true,
                        "keepState": true,
                        "tabMax": 30,
                        "index": {
                            "id": "10",
                            "href": "{% url 'manage_overview' %}",
                            "title": "{% trans '首页' %}"
                        }
                    },
                    "theme": {
                        "defaultColor": "2",
                        "defaultMenu": "dark-theme",
                        "allowCustom": true
                    },
                    "colors": [{
							"id": "1",
							"color": "#2d8cf0"
						},
						{
							"id": "2",
							"color": "#5FB878"
						},
						{
							"id": "3",
							"color": "#1E9FFF"
						}, {
							"id": "4",
							"color": "#FFB800"
						}, {
							"id": "5",
							"color": "darkgray"
						}
					],
                    "links": [{
                            "icon": "layui-icon layui-icon-website",
                            "title": "{% trans '官方网站' %}",
                            "href": "https://mrdoc.pro"
                        },
                        {
                            "icon": "layui-icon layui-icon-read",
                            "title": "{% trans '说明文档' %}",
                            "href": "https://doc.mrdoc.pro/project-7/"
                        },
                        {
                            "icon": "layui-icon layui-icon-fonts-code",
                            "title": "{% trans '开源地址' %}",
                            "href": "https://gitee.com/zmister/MrDoc"
                        },
                        {
                            "icon": "layui-icon layui-icon-survey",
                            "title": "{% trans 'QQ群' %}",
                            "href": "http://shang.qq.com/wpa/qunwpa?idkey=143c23a4ffbd0ba9137d2bce3ee86c83532c05259a0542a69527e36615e64dba"
                        },
						{
                            "icon": "layui-icon layui-icon-log",
                            "title": "{% trans '当前版本：' %}{{mrdoc_version}}",
                            "href": "https://gitee.com/zmister/MrDoc/tree/{{mrdoc_version}}/"
                        }
                    ],
                    "other": {
                        "keepLoad": 100
					},
					"header": {
						"message": []
					}
                }
				admin.setConfigType("json");
				admin.render(pear_admin_config);
			})
		</script>
		<script>
			var $ = layui.jquery;
			function Logout(){
				$.ajax({
					url:"{% url 'logout' %}",
					method:'post',
					headers: {"X-CSRFToken":'{{ csrf_token }}'},
					success:function(r){
						if(r.status){
							window.location.href = '/'
						}else{
							layer.msg("注销失败")
						}
					},
					error:function(){
						layer.msg("注销失败")
					}
				})
			}
		</script>
	</body>
</html>
